package com.itheima.d3_transform_stream;


import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * 目标：掌握字符输入转换流的作用。
 */
public class Test2InputStreamReader {
    public static void main(String[] args) {

        try (FileInputStream fr = new FileInputStream("day10io-app2/file/GBKFIle.txt");
             InputStreamReader isr = new InputStreamReader(fr, "GBK")) {
            int c;

            while ((c = isr.read()) != -1) {
                System.out.print((char) c);
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
